﻿using BaseDll;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO.Ports;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.ComponentModel;

namespace OtherDevice
{
    [Description("COMSO气密仪")]
    public class Air_1441: AT_Base
    {
        public Air_1441(string strName) : base(strName)
        {
            controlFrom = new Form_气密仪();
        }

        public override void Function_气密测试启动()
        {
            
        }
        public override int Fucntion_获取气密测试(ref double d_大泄露, ref double d_小泄露, int n_TimeOut = 2000)
        {
            m_SerialPort.DiscardInBuffer();
            m_SerialPort.DiscardOutBuffer();
            byte[] byte_Result=new byte[144];
            ReceiveData(ref byte_Result, n_TimeOut);
            string strResult= Encoding.Default.GetString(byte_Result);
            string[] list_Result = strResult.Split(' ');
            if (list_Result.Length < 5)
                return -2;
            d_大泄露 = Convert.ToDouble(list_Result[3]);
            d_小泄露 = Convert.ToDouble(list_Result[10]);
            return 0;
        }

    }
}